<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateTableViewsTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('table_views', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 100)->comment('模型名');
            $table->string('title', 100)->nullable()->comment('模型别名');
            $table->integer('table_id')->default(0)->nullable()->unsigned()->comment('主表');
            $table->string('space', 100)->nullable()->comment('命名空间');
            $table->integer('skey')->default(0)->nullable()->unsigned()->comment('关系表主键');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('table_views');
    }
}
